﻿@model UserPermission
<ul class="nav" id="side-menu">
    <li class="nav-header">
        <div class="dropdown profile-element">
            <span>
                <img alt="image" class="img-circle" src="@Url.Content("~/hplus/img/profile_small.jpg")" /></span>
            <a data-toggle="dropdown" class="dropdown-toggle" href="#"><span class="clear"><span
                class="block m-t-xs"><strong class="font-bold"></strong></span><span class="text-muted text-xs block">
                    @Model.CustomerName<b class="caret"></b></span> </span></a>
            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                <li><a class="J_menuItem" href="@Url.Action("ChangePassWord", "User")">修改密码</a>
                </li>
                <li class="divider"></li>
                <li><a href="@Url.Action("LoginOut", "Login")">安全退出</a> </li>
            </ul>
        </div>
        <div class="logo-element">
            H+
        </div>
    </li>
    @if (Model.MenuList != null && Model.MenuList.Count > 0)
    {
        var modularList = Model.MenuList.Where(m => m.MenuType == MenuTypeEnum.菜单模块).ToList();
        for (int i = 0; i < modularList.Count; i++)
        {
            var menuList = Model.MenuList.Where(m => m.ParentId == modularList[i].Id).ToList();
        <li><a href="#"><i class="fa fa-home"></i><span class="nav-label">@modularList[i].MenuName</span>
            <span class="fa arrow"></span></a>
            <ul class="nav nav-second-level">
                @foreach (var item in menuList)
                {
                    <li><a class="J_menuItem" href="@Url.Action(item.ActionName, item.ControllerName)">@item.MenuName</a>
                    </li>
                }
                <li><a class="J_menuItem" href="@Url.Action("Index", "SetUp")">刷新菜单</a></li>
            </ul>
        </li>
        }

    }
</ul>
